import java.util.List;
import java.util.Stack;
import java.util.*;

public class TextDemo {
    public static boolean backspaceCompare(String s, String t) {
        Stack<Character> stackS = new Stack<>();
        Stack<Character> stackT = new Stack<>();
        char tokenS =0;
        char tokenT =0;
        for(int i = 0;i<s.length();i++){
            tokenS = s.charAt(i);
            if(tokenS!='#'){
                stackS.push(tokenS);
            }else{
                for(int j = 0;j<2&&!stackS.isEmpty();j++){
                    stackS.pop();
                }
            }
        }
        for(int i = 0;i<t.length();i++){
            tokenT = t.charAt(i);
            if(tokenT!='#'){
                stackT.push(tokenT);
            }else{
                for(int j = 0;j<2&&!stackT.isEmpty();j++){
                    stackT.pop();
                }
            }
        }
        while(!stackS.isEmpty()&&!stackT.isEmpty()){
            if(stackS.pop()!=stackT.pop()){
                return false;
            }
        }
        if(stackS.isEmpty()&&stackT.isEmpty()){
            return true;
        }else{
            return false;
        }
    }
    public List<String> buildArray(int[] target, int n) {
        List<String> stack =new Stack<>();
        Stack<Integer> stackNum = new Stack<>();
        int index = 0;
        for(int i = 0;i<n&&index<target.length;i++){
            stackNum.push(i+1);
            stack.add("Push");
            if(target[index]!=stackNum.peek()){
                stack.add("Pop");
            }else{
                index++;
            }

        }
        return stack;
    }
    public static void main(String[] args) {
        String s = new String( "(()())(())(()(()))");
        TreeSet<>
        char[] ans = new char[]{3};
        String t = new String(ans);

    }

}
